<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>{{ repData }}</h1>
    </div>

    <script src="./node_modules/vue/dist/vue.js"></script>
    <script src="./node_modules/axios/dist/axios.js"></script>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                repData: []
            },
            created() {
                axios.get('http://127.0.0.1:5500/vue-07-lifecycle&ajax/db.json')
                    .then(response => {//function (response) {
                        // handle success
                        console.log(response.data, this);
                        this.repData = response.data
                    })
                    .catch(error => {//function (error) {
                        // handle error
                        console.log(error.message);
                    })
                    .finally(() => {//function () {
                        // always executed
                        console.log('finally');
                    });
            },
        })
    </script>
</body>

</html>